/*
*  Impp - Instant Messenger
*
*  Copyright (C) 2008  Oliver Schneider
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
#ifndef IPROTOCOL_H_
#define IPROTOCOL_H_

#include "../Buddy.h"
#include "../Group.h"
#include "../events/TypingState.h"
#include "../Actions.h"
#include "../Account.h"
#include <wx/event.h>

namespace Impp {

enum ConnectionState{
	CONNECTION_STATE_INVALID = 0,
	CONNECTION_STATE_DISCONNECTED,
	CONNECTION_STATE_CONNECTING,
	CONNECTION_STATE_CONNECTED,
};

class Group;
class Account;

class iProtocol : public wxEvtHandler
{

	DECLARE_ABSTRACT_CLASS(iProtocol)

public:
	iProtocol(){};
	virtual ~iProtocol(){};

	virtual void init(Account* account) = 0;
	virtual void sendMessage(ActionId id, Buddy* & buddy,const wxString & msg) = 0;
	virtual void connect(const ActionId & id, const Status & status, const wxString & statusMsg, const PrivacySetting & visibility) = 0;
	virtual void setStatus(const ActionId & id, const Status & status,const wxString & statusMsg = wxEmptyString) = 0;
	virtual void setPrivacySettings(const PrivacySetting & visibility) = 0;
	virtual void disconnect() = 0;
	virtual ConnectionState getConnectionState() = 0;
	virtual void requestAvatar(const ActionId & id, Buddy* buddy) = 0;
	virtual void requestStatusMessage(Buddy* buddy) = 0;
	virtual void requestShortUserInfo(Buddy* buddy) = 0;
	virtual void requestFullUserInfo(Buddy* buddy) = 0;
	virtual void replayAuthorisation(Buddy* buddy, bool accept,const wxString & reason) = 0;
	virtual void replayFileTransfare(const ActionId & id, Buddy* buddy, bool accept) = 0;
	virtual void checkUserStatus(Buddy* buddy) = 0;
	virtual void sendTypingNotification(Buddy* buddy, TypingState state) = 0;

	virtual void changeCustomName(Buddy* buddy,const wxString & newCustomName) = 0;
	virtual void changeBuddyGroup(Buddy* buddy,Group* newGroup) = 0;
	virtual void changeAddToPrivacyList(Buddy* buddy, const int & privacyList) = 0;
	virtual void changeRemoveFromPrivacyList(Buddy* buddy, const int & privacyList) = 0;
	virtual void changeOwnAvatar(const wxString & avatarFile) = 0;
	virtual Account* getAccount() = 0;
	virtual PrivacySetting getPrivacySettings() = 0;

	virtual Status getSupportedStatusMask() = 0;
	virtual int getExtraStatusCount() = 0;
	virtual wxString getExtraStatusName(int nr) = 0;

};

}

#endif /*PROTOCOL_H_*/
